# Contributor: Matt Dainty <matt+alpine@bodgit-n-scarper.com>
# Contributor: TBK <alpine@jjtc.eu>
# Contributor: Dermot Bradley <dermot_bradley@yahoo.com>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=py3-jsonpointer
pkgver=3.0.0
pkgrel=0
pkgdesc="Identify specific nodes in a JSON document (RFC 6901)"
url="https://github.com/stefankoegl/python-json-pointer"
arch="noarch"
license="BSD-3-Clause"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/stefankoegl/python-json-pointer/archive/v$pkgver.tar.gz"
builddir="$srcdir/python-json-pointer-$pkgver"

replaces="py-jsonpointer" # Backwards compatibility
provides="py-jsonpointer=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m unittest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
df7307942f1532468e61dfa6bb9606ede56cbcd3b9fad3e690e7d9127ac56e709688d5143a80e99f2f1ae92415f156da975a7741bb51222579a51d12ee640253  py3-jsonpointer-3.0.0.tar.gz
"
